import VueRouter from 'vue-router'

export default new VueRouter({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      name: 'home',
      path: '/home',
      component: () => import('../views/home'),
      redirect: '/home/weather',
      children: [
        {
          name: 'home-wea',
          path: 'weather',
          component: () => import('../views/home/weather')
        },
        {
          name: 'home-rad',
          path: 'radiation',
          component: () => import('../views/home/radiation')
        }
      ]
    },
    {
      name: 'global',
      path: '/global',
      component: () => import('../views/global')
    },
    {
      name: 'sun',
      path: '/sun',
      component: () => import('../views/sun')
    },
    {
      name: 'temperature',
      path: '/temperature',
      component: () => import('../views/temperature')
    },
    {
      name: 'databases',
      path: '/databases',
      component: () => import('../views/databases'),
      redirect: '/databases/scroll',
      children: [
        {
          name: 'db-scroll',
          path: 'scroll',
          component: () => import('@/views/databases/scroll')
        },
        {
          name: 'db-time',
          path: 'time',
          component: () => import('@/views/databases/time')
        }
      ]
    },
    {
      name: 'capsule',
      path: '/capsule',
      component: () => import('../views/capsule')
    },
    { path: '*', redirect: '/home', hidden: true }
  ]
})
